package edu.dayu.proxyTest3;

import edu.dayu.proxyTest.HelloService;
import edu.dayu.proxyTest.HelloServiceImpl;

public class Test {
    public static void main(String[] args) {
        TransactionInterceptor interceptor = new TransactionInterceptor();
        LogInterceptor logInterceptor = new LogInterceptor();
        InterceptorChain interceptorChain = new InterceptorChain();
        interceptorChain.addInterceptor(interceptor);
        interceptorChain.addInterceptor(logInterceptor);
        HelloService o = (HelloService) interceptorChain.pluginAll(new HelloServiceImpl());
        o.hello();
        //log 日志
        //------插入前置通知代码-------------
        //hello
        //------插入后置处理代码-------------
        //log 之前方法之后
    }
}
